package com.xzwzz.kotlindemo

import com.xzwzz.kotlindemo.utils.ExcelHelper
import java.util.*
import java.util.concurrent.Executors

object ImportNewVideoData {
    const val mYear = "2022"

    val versionMap = mapOf<String, Map<String, String>>(
            "新高考" to mapOf(
                    "生物" to "679",
                    "语文" to "675",
                    "英语" to "676",
                    "物理" to "677",
                    "化学" to "678",
                    "政治" to "680",
                    "历史" to "681",
                    "地理" to "682",
                    "数学" to "683"
            ),
            "全国" to mapOf(
                    "语文" to "435",
                    "文数" to "436",
                    "理数" to "437",
                    "英语" to "438",
                    "物理" to "439",
                    "化学" to "440",
                    "生物" to "441",
                    "政治" to "442",
                    "历史" to "443",
                    "地理" to "444",
                    "文综" to "445",
                    "理综" to "446"),
            "北京" to mapOf(
                    "语文" to "447",
                    "数学" to "448",
                    "英语" to "449",
                    "物理" to "450",
                    "化学" to "451",
                    "生物" to "452",
                    "政治" to "453",
                    "历史" to "454",
                    "地理" to "455"
            ),
            "山东" to mapOf(
                    "语文" to "456",
                    "数学" to "457",
                    "英语" to "458",
                    "物理" to "459",
                    "化学" to "460",
                    "生物" to "461",
                    "政治" to "462",
                    "历史" to "463",
                    "地理" to "464"
            ),
            "上海" to mapOf(
                    "语文" to "465",
                    "数学" to "466",
                    "英语" to "467",
                    "物理" to "468",
                    "化学" to "469",
                    "生物" to "470",
                    "政治" to "471",
                    "历史" to "472",
                    "地理" to "473"
            ),
            "江苏" to mapOf(
                    "语文" to "474",
                    "文数" to "475",
                    "理数" to "476",
                    "英语" to "477",
                    "物理" to "478",
                    "化学" to "479",
                    "生物" to "480",
                    "政治" to "481",
                    "历史" to "482",
                    "地理" to "483",
                    "数学" to "685"
            ),
            "浙江" to mapOf(
                    "语文" to "484",
                    "数学" to "485",
                    "英语" to "487",
                    "物理" to "488",
                    "化学" to "489",
                    "生物" to "490",
                    "政治" to "491",
                    "历史" to "492",
                    "地理" to "493",
                    "技术" to "494"
            )

    )

    val executors = Executors.newScheduledThreadPool(5)

    val countMap = mutableMapOf<String, Int>()

    fun addCount(category: String) {
        if (countMap.containsKey(category)) {
            countMap[category] = (countMap[category]!! + 1)
        } else {
            countMap[category] = 1
        }
    }

    private val justSplit = false;

    private val excelHelper = ExcelHelper()

    @JvmStatic
    fun main(args: Array<String>) {
        while (true) {
            println("请输入excel路径")
            val scanner = Scanner(System.`in`)
            val path = scanner.nextLine().trim()

            executors.submit {
                excelHelper.startConvertMerge(path)
                println("输出完成")
            }
        }
    }
}
